package com.boot2523.control;

import com.boot2523.bean.Order;
import com.boot2523.service.OrderProducer;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "order")
public class OrderC {
    @Resource
    public OrderProducer op;
    public OrderProducer orderProducer;
    public OrderC(OrderProducer orderProducer){
        this.orderProducer=orderProducer;
    }
    @PostMapping(value = "/send")
    public String sendOrder(@RequestBody Order o){
        op.sendOrder(o);
        return "发送成功";
    }
}
